/**
 * @author Morten Tranberg Hansen (mth@daimi.au.dk)
 * @date   August 28 2008
 */

#ifndef ENERGY_MEASUREMENT_H
#define ENERGY_MEASUREMENT_H

typedef uint8_t energy_action_t;

enum {
	// AM ids
	AM_ENERGY_DATA_MSG = 0xE1,
	AM_ENERGY_COMMAND_MSG = 0xE2,
	
	// Waiting times all measured in 32768 ticks per second.
	WAIT_BETWEEN_PORTS = 1,
	WAIT_CHARGE = 8192,// =32768/4
	
	// Command actions
	ENERGY_ACTION_START = 1,
	ENERGY_ACTION_STOP = 2,
};

typedef struct energy_command_msg {
	energy_action_t action;
} energy_command_msg_t;

typedef struct energy_data_msg {
	uint32_t seqno;
	uint32_t time;
	uint8_t flags;
} energy_data_msg_t;

#endif